package com.csizg.facemodel.strategy;

import android.content.Context;
import com.csizg.facemodel.util.CompareResult;
import com.csizg.facemodel.util.FaceUtil;

/**
 * 图片对比相似度 的人脸识别策略
 *
 * @author haohao(ronghao3508@gmail.com) on 2018/5/23 20:12
 * @version v1.0
 */
public class ImageCompareStrategy implements ICompareStrategy {

    private double mThreshold = 85d;//图片比对的阈值

    @Override
    public void setThreshold(double threshold) {
        mThreshold = threshold;
    }

    @Override
    public void init(Context context) {
    }

    @Override
    public void prepare(Context context) {
    }

    @Override
    public CompareResult compare(Context context, String face2) {
        return FaceUtil.compareForFiles(context, face2, (int) mThreshold);
    }
}
